/*
最大子数组和
class Solution {
    public int maxSubArray(int[] nums) {
        int[] dp = new int[nums.length];
        dp[0] = nums[0];
        int ret = dp[0];
        for(int i = 1;i < nums.length;i++) {
            if(nums[i] +dp[i-1] > nums[i]) {
                dp[i] = nums[i] +dp[i-1];
            } else {
                dp[i] = nums[i];
            }
            ret = Math.max(ret,dp[i]);
        }
        return ret;
    }
}

合并区间
class Solution {
    public int[][] merge(int[][] intervals) {
        Arrays.sort(intervals,(v1,v2) ->{
            return v1[0] - v2[0];
        });
        int len = intervals.length;
        List<int[]> ret = new ArrayList<>();
        int left = intervals[0][0],right = intervals[0][1];
        for(int i = 1 ;i < len ; i++) {
            int a = intervals[i][0] , b = intervals[i][1];
            if(a <= right) {
                right = Math.max(right,b);
            }else {
                ret.add(new int[]{left,right});
                left = a;
                right = b;
            }
        }
        ret.add(new int[]{left,right});
        return ret.toArray(new int[0][]);
    }
}
 */